package com.upb.webserver.dao.mapper;

import com.upb.webserver.dao.entity.TbCompanyDeveloper;
import com.upb.webserver.dao.entity.TbCompanyDeveloperExample;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
import java.util.List;
import java.util.Optional;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;

public interface TbCompanyDeveloperMapper {

    @Select({ "select", TbCompanyDeveloperSqlProvider.ALL_COLUMN_FIELDS, "from tb_company_developer", "where developer_id = #{developerId,jdbcType=INTEGER}" })
    @Results({ @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "company_id", property = "companyId", jdbcType = JdbcType.INTEGER), @Result(column = "developer_id", property = "developerId", jdbcType = JdbcType.INTEGER), @Result(column = "status", property = "status", jdbcType = JdbcType.TINYINT), @Result(column = "create_from_platform", property = "createFromPlatform", jdbcType = JdbcType.TINYINT), @Result(column = "create_by", property = "createBy", jdbcType = JdbcType.INTEGER), @Result(column = "gmt_create", property = "gmtCreate", jdbcType = JdbcType.TIMESTAMP), @Result(column = "gmt_modified", property = "gmtModified", jdbcType = JdbcType.TIMESTAMP) })
    TbCompanyDeveloper selectByDeveloper(@Param("developerId") Integer developerId);

    @Select({ "<script>", "select", TbCompanyDeveloperSqlProvider.ALL_COLUMN_FIELDS, "from tb_company_developer", "where company_id in", "<foreach collection='companyIdList' item='companyId' open='(' separator=',' close=')'>", "#{companyId}", "</foreach>", "</script>" })
    @Results({ @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "company_id", property = "companyId", jdbcType = JdbcType.INTEGER), @Result(column = "developer_id", property = "developerId", jdbcType = JdbcType.INTEGER), @Result(column = "status", property = "status", jdbcType = JdbcType.TINYINT), @Result(column = "create_from_platform", property = "createFromPlatform", jdbcType = JdbcType.TINYINT), @Result(column = "create_by", property = "createBy", jdbcType = JdbcType.INTEGER), @Result(column = "gmt_create", property = "gmtCreate", jdbcType = JdbcType.TIMESTAMP), @Result(column = "gmt_modified", property = "gmtModified", jdbcType = JdbcType.TIMESTAMP) })
    List<TbCompanyDeveloper> selectByCompanyIdList(@Param("companyIdList") List<Integer> companyIdList);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_company_developer
     *
     * @mbg.generated
     */
    @SelectProvider(type = TbCompanyDeveloperSqlProvider.class, method = "countByExample")
    long countByExample(TbCompanyDeveloperExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_company_developer
     *
     * @mbg.generated
     */
    @DeleteProvider(type = TbCompanyDeveloperSqlProvider.class, method = "deleteByExample")
    int deleteByExample(TbCompanyDeveloperExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_company_developer
     *
     * @mbg.generated
     */
    @Delete({ "delete from tb_company_developer", "where id = #{id,jdbcType=INTEGER}" })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_company_developer
     *
     * @mbg.generated
     */
    @Insert({ "insert into tb_company_developer (company_id, developer_id, ", "status, create_from_platform, ", "create_by, gmt_create, ", "gmt_modified)", "values (#{companyId,jdbcType=INTEGER}, #{developerId,jdbcType=INTEGER}, ", "#{status,jdbcType=TINYINT}, #{createFromPlatform,jdbcType=TINYINT}, ", "#{createBy,jdbcType=INTEGER}, #{gmtCreate,jdbcType=TIMESTAMP}, ", "#{gmtModified,jdbcType=TIMESTAMP})" })
    @SelectKey(statement = "SELECT LAST_INSERT_ID()", keyProperty = "id", before = false, resultType = Integer.class)
    int insert(TbCompanyDeveloper record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_company_developer
     *
     * @mbg.generated
     */
    @InsertProvider(type = TbCompanyDeveloperSqlProvider.class, method = "insertSelective")
    @SelectKey(statement = "SELECT LAST_INSERT_ID()", keyProperty = "id", before = false, resultType = Integer.class)
    int insertSelective(TbCompanyDeveloper record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_company_developer
     *
     * @mbg.generated
     */
    @SelectProvider(type = TbCompanyDeveloperSqlProvider.class, method = "selectByExample")
    @Results({ @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "company_id", property = "companyId", jdbcType = JdbcType.INTEGER), @Result(column = "developer_id", property = "developerId", jdbcType = JdbcType.INTEGER), @Result(column = "status", property = "status", jdbcType = JdbcType.TINYINT), @Result(column = "create_from_platform", property = "createFromPlatform", jdbcType = JdbcType.TINYINT), @Result(column = "create_by", property = "createBy", jdbcType = JdbcType.INTEGER), @Result(column = "gmt_create", property = "gmtCreate", jdbcType = JdbcType.TIMESTAMP), @Result(column = "gmt_modified", property = "gmtModified", jdbcType = JdbcType.TIMESTAMP) })
    List<TbCompanyDeveloper> selectByExample(TbCompanyDeveloperExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_company_developer
     *
     * @mbg.generated
     */
    @Select({ "select", "id, company_id, developer_id, status, create_from_platform, create_by, gmt_create, ", "gmt_modified", "from tb_company_developer", "where id = #{id,jdbcType=INTEGER}" })
    @Results({ @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "company_id", property = "companyId", jdbcType = JdbcType.INTEGER), @Result(column = "developer_id", property = "developerId", jdbcType = JdbcType.INTEGER), @Result(column = "status", property = "status", jdbcType = JdbcType.TINYINT), @Result(column = "create_from_platform", property = "createFromPlatform", jdbcType = JdbcType.TINYINT), @Result(column = "create_by", property = "createBy", jdbcType = JdbcType.INTEGER), @Result(column = "gmt_create", property = "gmtCreate", jdbcType = JdbcType.TIMESTAMP), @Result(column = "gmt_modified", property = "gmtModified", jdbcType = JdbcType.TIMESTAMP) })
    TbCompanyDeveloper selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_company_developer
     *
     * @mbg.generated
     */
    @UpdateProvider(type = TbCompanyDeveloperSqlProvider.class, method = "updateByExampleSelective")
    int updateByExampleSelective(@Param("record") TbCompanyDeveloper record, @Param("example") TbCompanyDeveloperExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_company_developer
     *
     * @mbg.generated
     */
    @UpdateProvider(type = TbCompanyDeveloperSqlProvider.class, method = "updateByExample")
    int updateByExample(@Param("record") TbCompanyDeveloper record, @Param("example") TbCompanyDeveloperExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_company_developer
     *
     * @mbg.generated
     */
    @UpdateProvider(type = TbCompanyDeveloperSqlProvider.class, method = "updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(TbCompanyDeveloper record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_company_developer
     *
     * @mbg.generated
     */
    @Update({ "update tb_company_developer", "set company_id = #{companyId,jdbcType=INTEGER},", "developer_id = #{developerId,jdbcType=INTEGER},", "status = #{status,jdbcType=TINYINT},", "create_from_platform = #{createFromPlatform,jdbcType=TINYINT},", "create_by = #{createBy,jdbcType=INTEGER},", "gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},", "gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}", "where id = #{id,jdbcType=INTEGER}" })
    int updateByPrimaryKey(TbCompanyDeveloper record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_company_developer
     *
     * @mbg.generated
     */
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    @Insert({ "<script>", "insert into tb_company_developer (company_id, ", "developer_id, status, ", "create_from_platform, create_by, ", "gmt_create, gmt_modified)", "values<foreach collection=\"list\" item=\"detail\" index=\"index\" separator=\",\">(#{detail.companyId,jdbcType=INTEGER}, ", "#{detail.developerId,jdbcType=INTEGER}, #{detail.status,jdbcType=TINYINT}, ", "#{detail.createFromPlatform,jdbcType=TINYINT}, #{detail.createBy,jdbcType=INTEGER}, ", "#{detail.gmtCreate,jdbcType=TIMESTAMP}, #{detail.gmtModified,jdbcType=TIMESTAMP})</foreach></script>" })
    int batchInsert(List<TbCompanyDeveloper> list);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table tb_company_developer
     *
     * @mbg.generated
     */
    @SelectProvider(type = TbCompanyDeveloperSqlProvider.class, method = "getOneByExample")
    @Results({ @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "company_id", property = "companyId", jdbcType = JdbcType.INTEGER), @Result(column = "developer_id", property = "developerId", jdbcType = JdbcType.INTEGER), @Result(column = "status", property = "status", jdbcType = JdbcType.TINYINT), @Result(column = "create_from_platform", property = "createFromPlatform", jdbcType = JdbcType.TINYINT), @Result(column = "create_by", property = "createBy", jdbcType = JdbcType.INTEGER), @Result(column = "gmt_create", property = "gmtCreate", jdbcType = JdbcType.TIMESTAMP), @Result(column = "gmt_modified", property = "gmtModified", jdbcType = JdbcType.TIMESTAMP) })
    Optional<TbCompanyDeveloper> getOneByExample(TbCompanyDeveloperExample example);
}
